package com.appspot.categoryeditor.controller;

import org.slim3.controller.Controller;
import org.slim3.controller.Navigation;

import com.appspot.categoryeditor.utils.UserUtils;
import com.google.appengine.api.users.UserService;
import com.google.appengine.api.users.UserServiceFactory;

public class LogoutController extends Controller {
	@Override
	public Navigation run() throws Exception {
		
		UserService userService = UserServiceFactory.getUserService();
		
		if (UserUtils.checkLogin(request)) {
			return redirect(userService.createLogoutURL("/"));
		}else{
			return redirect("/");
		}
	}

}
